<template>
	<view style="background: #FFFFFF;">
		<view class="CreditFileHead">
			基本资料
			<text style="font-size: 24px;font-weight: 500;font-size: 24rpx;color: #888888;margin-left: 10rpx;">申请贷款的必填项</text>
		</view>
		<view class="CreditFileBottom" @click="CreditFile(1)">
			<text>实名认证</text>
			<text :class="authentica1 == '已认证' ? 'CreditFileBottomText':'CreditFileBottomText2'">{{authentica1}}</text>
		</view>
		<view class="CreditFileBottom" @click="CreditFile(2)">
			<text>基本信息</text>
			<text :class="authentica2 == '已认证' ? 'CreditFileBottomText':'CreditFileBottomText2'">{{authentica2}}</text>
		</view>
		<view class="CreditFileBottom" @click="CreditFile(3)">
			<text>补充信息</text>
			<text :class="authentica3 == '已认证' ? 'CreditFileBottomText':'CreditFileBottomText2'">{{authentica3}}</text>
		</view>
		<view class="CreditFileBottom" @click="CreditFile(5)">
			<text>提额信息</text>
			<text :class="authentica4 == '已认证' ? 'CreditFileBottomText':'CreditFileBottomText2'">{{authentica4}}</text>
		</view>
		<view class="CreditFileMSLQ" @click="CreditFile(6)">
			马上领钱
		</view>
		<view class="CreditFileMSLQJS">
			精选12款高通过率产品，完成以上资料即刻领钱
		</view>
	</view>
</template>

<script>
	import {VUE_API_URL} from "@/components/pulugins/index"
	export default {
		components: {
			
		},
		data() {
			return {
				authentication:'',
				authentica1:'去认证',
				authentica2:'去认证',
				authentica3:'去认证',
				authentica4:'去认证'
			}
		},
		onShow() {
			var that = this;
			that.token = uni.getStorageSync('token');
			that.UserInfo();
		},
		onLoad() {
			this.UserInfo();
		},
		methods: {
			UserInfo(){
				var that = this;
				that.token = uni.getStorageSync('token');
				uni.request({
				    url: VUE_API_URL + '/user/info', 
					method:'POST',
				    data: {
				        
				    },
				    header: {
				        'Authori-zation': 'Bearer ' + that.token //自定义请求头信息
				    },
				    success: (res) => {
						console.log(res);
						var authentica = res.data.data.authentication;
						var arr = authentica.split(',');
						for(var i=0;i<arr.length;i++){
							if(arr[i]==1){
								that.authentica1='已认证'
							}else if(arr[i]==2){
								that.authentica2='已认证'
							}else if(arr[i]==3){
								that.authentica3='已认证'
							}else if(arr[i]==4){
								that.authentica4='已认证'
							}
						}
				    }
				});	 
			},
			CreditFile(index){
				if(index == 1){				//实名认证
					uni.navigateTo({
						url: '../second/RealNameAuthentication'
					});
				}else if(index == 2){		//基本信息
					uni.navigateTo({
						url: '../second/EssentialInformation'
					});
				}else if(index == 3){ 		//补充信息
					uni.navigateTo({		
					    url: '../second/Supplement'
					});
				}else if(index == 4){		//收款卡信息
					uni.navigateTo({		
					    url: '../second/BankCardInformation'
					});
				}else if(index == 5){		//提额信息
					uni.navigateTo({
						url: '../second/IncreaseInformation'
					});
				}else if(index == 6){		//领钱
					uni.navigateTo({
						url: '../second/receiveQuota'
					});
				}
			}
		},
	}
</script>

<style>
	.CreditFileMSLQJS{
		width: 100%;
		text-align: center;
		font-size: 20rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #888888;
		background: #FFFFFF;
		padding: 20rpx 0 50rpx 0;
	}
	.CreditFileMSLQ{
		width: 450rpx;
		height: 95rpx;
		line-height: 95rpx;
		text-align: center;
		margin: auto;
		background: linear-gradient(-84deg, #DFBA94, #DFAD7B);
		box-shadow: 0px 3px 10px 0px rgba(0, 0, 0, 0.16);
		border-radius: 48px;
		color: #FFFFFF;
		font-family: PingFang-SC;
		font-size: 36rpx;
	}
	.CreditFileBottomText2{
		width: 116rpx;
		height: 45rpx;
		background: #FBE4CE;
		border-radius: 23rpx;
		font-size: 30rpx;
		color: #DFAF7F;
		float: right;
		line-height: 45rpx;
		text-align: center;
		display: inline-block;
		position: relative;
		top: 30rpx;
	}
	.CreditFileBottomText{
		width: 116rpx;
		height: 45rpx;
		background: #F8F8F8;
		border-radius: 23rpx;
		font-size: 30rpx;
		color: #888888;
		float: right;
		line-height: 45rpx;
		text-align: center;
		display: inline-block;
		position: relative;
		top: 30rpx;
	}
	.CreditFileBottom{
		height: 110rpx;
		line-height: 110rpx;
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #000000;
		padding: 0 50rpx;
		background: #FFFFFF;
		position: relative;
	}
	page{
		background: rgb(248,248,248);
	}
	.CreditFileHead{
		font-size: 38rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #000000;
		height: 90rpx;
		line-height: 90rpx;
		padding: 0 52rpx;
		box-sizing: border-box;
		background: #F8F8F8;
	}
</style>
